import "@/assets/styles/index.scss";
// import 'uno.css'// 注册插件
import "normalize.css/normalize.css";
import "element-plus/theme-chalk/dark/css-vars.css";
import { createApp } from "vue";
import { createPinia } from "pinia";
import { useDict } from "@/utils/dict";

import App from "./App.vue";
import router from "./router";

import "./permission";

import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'

// import * as directive from '@/directive'

import {noNegative} from '@/utils/ruoyi'

const app = createApp(App);
// 全局方法挂载
app.config.globalProperties.useDict = useDict;

app.use(createPinia());
app.use(router);
app.use(ElementPlus, {
    locale: zhCn,
  })



//   // 自定义指令
// directive(app);
app.directive('no-negative', noNegative); 
window.addEventListener(
    'wheel',
    (event) => {
      const target = event.target ;
      console.log('????123')
      // 检查目标元素是否是聚焦的 input[type="number"]
      if (target.tagName === 'INPUT' && target.type === 'number' && target === document.activeElement) {
        event.preventDefault();
      }
    },
    { passive: false } // 设置为非被动模式
  );

app.mount("#app");
